home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / sys / amiga / programmer / 4226 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  3.1 KB

  1. Path: bruce.cs.monash.edu.au!not-for-mail
  2. From: bmeyer@bruce.cs.monash.edu.au (Bernd Meyer)
  3. Newsgroups: comp.sys.amiga.programmer,comp.sys.amiga.advocacy,comp.os.ms-windows.advocacy
  4. Subject: Re: intuition inefficient ?
  5. Followup-To: comp.sys.amiga.programmer,comp.sys.amiga.advocacy,comp.os.ms-windows.advocacy
  6. Date: 26 Feb 1996 08:50:03 GMT
  7. Organization: Computer Science, Monash University, Australia
  8. Distribution: world
  9. Message-ID: <4grs7r$plr@harbinger.cc.monash.edu.au>
  10. References: <4gm2qg$8lk@sunsystem5.informatik.tu-muenchen.de>
  11. NNTP-Posting-Host: molly.cs.monash.edu.au
  12. X-NNTP-Posting-User: bmeyer
  13. X-Newsreader: TIN [UNIX 1.3 950823BETA PL0]
  14.  
  15. Juergen "Rally" Fischer (fischerj@Informatik.TU-Muenchen.DE) wrote:
  16. : My argument was, that a given hardware, if supplying all those goodies
  17. : like vblank interrupt and timers would run animations best with
  18. : kickstart. His re was that future Win versions might also support this
  19. : and that kickstart isn't portable due to its features. Well, a Win
  20. : version using vblank would need something more than a PC, something
  21. : with a blank interrupt. An Amiga, for example ;)
  22.  
  23. Or, Juergen, a PC with a VGA card? Shocking idea, isn't it? But guess
  24. what --- there is two standard ways to catch the vblank signal on a 
  25. VGA card, and one of them is using an interrupt.
  26.  
  27. Most animation programs, however, go with the other way --- which is
  28. making sure you start waiting for it a bit early, and just poll the
  29. register. This is due to the fact that almost everyone quickly disables
  30. the vblank interrupt as wasting valuable resources.
  31.  
  32. Now of course, you might not want to have to make sure that you are
  33. in the right spot at the right time. You might want to run the main
  34. loop of you program as fast and long as possible --- no problem. You
  35. want an interrupt, you get one. How?
  36.  
  37. Well, when you start the program and switched into the desired mode,
  38. you just take half a second to actually measure the frequency of the
  39. vblank signals. You can then set up one of those high precision timers
  40. found in every single PC, and start it as soon as you see the next
  41. vblank signal.
  42.  
  43. Now of course you set it to a time that is only marginally shorter than
  44. the time it takes the video card to display one full screen. So as soon
  45. as that timer interrupt kicks in, you set it up again, then wait for
  46. the vblank signal (which will happen almost immediately), and restart
  47. the timer as soon as you see it.
  48.  
  49. Next you do whatever you want to do when the vblank signal appears, and
  50. afterwards simply return from the interrupt and go on with your main 
  51. loop. 
  52.  
  53. Now was that really so hard? All of the functionality used in this 
  54. example is very well documented and readily available under DOS and,
  55. I presume, Windows.
  56.  
  57. : We flamed what's more likely, kickstart getting mem protection features
  58. : or win getting vblank features ;)
  59.  
  60. You probably know where my money is. Have a look at the SVGALIB for
  61. linux, especially the "wait_vblank" function....
  62.  
  63. : I can't believe they'll ever implement those nice little things A500 
  64. : already had (vblank & stuff) into PC hardware _and_ the OSes (win, linux).
  65.  
  66. And I can't believe how narrow-minded you are, sorry.
  67.  
  68. Bernie
  69.  
  70.